<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<script type="text/javascript" src="<?php echo base_url()?>uploadify/jquery-1.4.2.min.js"></script>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>Welcome to XPages</title>
<style type="text/css">
body{
		
}
#loginhead{
	background:url(<?php echo base_url()?>images/loginHeader.jpg);
	height:500px;
	min-width:800px;
	color:#FFFFFF;
        
}
#statichead{
	width:800px;
	padding-top:20px;
	margin:0 auto;
	font-size:12px;
}
#left_logo{
	float:left;
}
#right_login{
	float:right;
	
}
.inputtext{
	border:1px #CCCCCC solid;
	width:140px;
        height:22px;
        opacity: .9;
        padding-left:13px;
-webkit-box-shadow: 0 -1px 0 rgba(0, 0, 0, .4),inset 0 1px 2px rgba(0, 0, 0, .3);
-moz-box-shadow: 0 -1px 0 rgba(0, 0, 0, .4),inset 0 1px 2px rgba(0, 0, 0, .3);
box-shadow: 0 -1px 0 rgba(0, 0, 0, .4),inset 0 1px 2px rgba(0, 0, 0, .3);
border: none!important;
-webkit-transition: opacity 1s;
-moz-transition: opacity 1s;
-o-transition: opacity 1s;
-moz-border-radius: 40px;
-webkit-border-radius: 40px;
border-radius: 40px;
background: rgba(255, 255, 255, .9);
color:#5e5e55;
font: 15px "Helvetica Neue",Arial,sans-serif;
}
#submitlogin{
	border:0;
	font-weight:bold;
	cursor:pointer;
}
#messages_container{
	margin:0 auto 0 auto;
}
#messages{
	min-width:90px;
	margin:0 auto 0 auto;
	border:2px red solid;
	/*background-color:#FFAA11;*/
	padding:3px;
	text-decoration:underline;
	font-weight:bold;
	font-size:16px;
	color:#FF0000;
	display:none;
        text-align: center;
        font: 15px "Helvetica Neue",Arial,sans-serif;
}
#container{
	margin:0 auto 0 auto;
}
#content{
	width:800px;
	margin:0 auto;
}
#register{
	width:350px;
	float:right;
	margin:0px 0 0 0px;
}
#adv{
	width:350px;
	float:left;
	margin-top:50px;
        
}
.reg_label{
	width:120px;
	text-align:right;
	font-size:13px;
}
.reg_input{
	width:200px;
	height:22px;
	padding:3px;
        padding-left:10px;
	opacity: .9;
-webkit-box-shadow: 0 -1px 0 rgba(0, 0, 0, .4),inset 0 1px 2px rgba(0, 0, 0, .3);
-moz-box-shadow: 0 -1px 0 rgba(0, 0, 0, .4),inset 0 1px 2px rgba(0, 0, 0, .3);
box-shadow: 0 -1px 0 rgba(0, 0, 0, .4),inset 0 1px 2px rgba(0, 0, 0, .3);
border: none!important;
-webkit-transition: opacity 1s;
-moz-transition: opacity 1s;
-o-transition: opacity 1s;
-moz-border-radius: 40px;
-webkit-border-radius: 40px;
border-radius: 40px;
background: rgba(255, 255, 255, .6);
color:#5e5e55;
font: 15px "Helvetica Neue",Arial,sans-serif;
}
.reg_input:focus{
	width:200px;
outline:none;
	padding:3px;
	padding-left:10px;
        height:22px;
-webkit-box-shadow: 0 -1px 0 rgba(0, 0, 0, .4),inset 0 1px 2px rgba(0, 0, 0, .3);
-moz-box-shadow: 0 -1px 0 rgba(0, 0, 0, .4),inset 0 1px 2px rgba(0, 0, 0, .3);
box-shadow: 0 -1px 0 rgba(0, 0, 0, .4),inset 0 1px 2px rgba(0, 0, 0, .3);
border: none!important;
-moz-border-radius: 40px;
-webkit-border-radius: 40px;
border-radius: 40px;
background: rgb(255, 255, 255);
color:#5e5e55;
font: 15px "Helvetica Neue",Arial,sans-serif;
}
.font_style
{
font: 15px "Helvetica Neue",Arial,sans-serif;
}
input::-webkit-input-placeholder {
    color:#5e5e55;
}
/*input[type="text"], input[type="email"], input[type="password"], textarea, select {
    -webkit-appearance: none;
}*/

input:-moz-placeholder {
    color:white;
}
#search{
opacity: .9;
-webkit-box-shadow: 0 -1px 0 rgba(0, 0, 0, .4),inset 0 1px 2px rgba(0, 0, 0, .3);
-moz-box-shadow: 0 -1px 0 rgba(0, 0, 0, .4),inset 0 1px 2px rgba(0, 0, 0, .3);
box-shadow: 0 -1px 0 rgba(0, 0, 0, .4),inset 0 1px 2px rgba(0, 0, 0, .3);
-webkit-rtl-ordering: logical;
-webkit-user-select: text;
cursor: auto;
letter-spacing: normal;
word-spacing: normal;
line-height: normal;
text-transform: none;
text-indent: 0px;
text-shadow: none;
display: inline-block;
text-align: -webkit-auto;
-webkit-transition: opacity 1s;
-moz-transition: opacity 1s;
-o-transition: opacity 1s;
-moz-border-radius: 40px;
-webkit-border-radius: 40px;
border-radius: 40px;
padding-left:40px;
width: 314px;
height:35px;
background: rgba(255, 255, 255, 0.6);
font: 15px "Helvetica Neue",Arial,sans-serif;
border: 1px solid rgba(0,0,0, 0.2);
outline:none;
}
#search:focus{
opacity: .9;
-webkit-box-shadow: 0 -1px 0 rgba(0, 0, 0, .4),inset 0 1px 2px rgba(0, 0, 0, .3);
-moz-box-shadow: 0 -1px 0 rgba(0, 0, 0, .4),inset 0 1px 2px rgba(0, 0, 0, .3);
box-shadow: 0 -1px 0 rgba(0, 0, 0, .4),inset 0 1px 2px rgba(0, 0, 0, .3);
border: 1px solid rgba(0,0,0, 0.2);
-webkit-transition: opacity 1s;
-moz-transition: opacity 1s;
-o-transition: opacity 1s;
-moz-border-radius: 40px;
-webkit-border-radius: 40px;
border-radius: 40px;
padding-left:40px;
width: 314px;
height:35px;
background: rgb(255, 255, 255);
font: 15px "Helvetica Neue",Arial,sans-serif;
outline:none;

}
#searchResults{
width:800px;
min-height:500px;
/*border: 1px solid rgba(0,0,0, 0.5);*/
margin-top:3px;
visibility: hidden;
display:none;
color:black;
font: 17px "Helvetica Neue",Arial,sans-serif;
text-overflow: ellipsis;
word-wrap: break-word;overflow:hidden;
margin-left: -20px;
}
#show_reg
{
    color:#FFFFFF;
    position: absolute;
    margin-left: 395px;
    margin-top: 28px;
    font: 17px "Helvetica Neue",Arial,sans-serif;
    visibility: hidden;
    cursor:pointer;


}
</style>
<script type="text/javascript">
    if (navigator.userAgent.toLowerCase().indexOf("chrome") >= 0) {
    $(window).load(function(){
        $('input:-webkit-autofill').each(function(){
            var text = $(this).val();
            var name = $(this).attr('name');
            $(this).after(this.outerHTML).remove();
            $('input[name=' + name + ']').val(text);
        });
    });
}
//var d="<?php echo isset($result)?>";
//if(d=="1")
//document.getElementById("messages").style.display="block";
var result=new Array();
function searchKeyPress(e){
if (window.event) { e = window.event; }
if (e.keyCode == 13)
{

    searchPublicsit();
    document.getElementById("messages").style.visibility="hidden";
    document.getElementById("registerform").style.visibility="hidden";
    $("#loginhead").animate({height: "72px"});
    $("#searchDiv").animate({paddingTop:"0px"},{complete:function(){
        document.getElementById("searchResults").style.visibility="visible";
        document.getElementById("searchResults").style.display="block";
        document.getElementById("show_reg").style.visibility="visible";
        
    }});
    
}


}
function searchPublicsit()
{
    var str=$('#search').val();
    //sending the data to the controller    NOAM PUT UR CONTROLLER NAME HERE
    var tokens = str.split(" ");
    for(var i = 0 ; i < tokens.length ; i++)
    {
        tokens[i] = "'" + tokens[i]+ "'" ;
    }
    var tokensString=tokens.join(",");
    var url='<?php echo base_url()?>searchengine/publicsearch_home/';
        $.post(url, {tags:tokensString},function(data) 
        {
            //var result=eval('('+data+')');
            //alert(result[0].publicResults);
            document.getElementById("searchResults").innerHTML=data;
        });
}
function showReg()
{
    document.getElementById("messages").style.visibility="visible";
    document.getElementById("searchResults").style.visibility="hidden";
    document.getElementById("searchResults").style.display="none";
    document.getElementById("show_reg").style.visibility="hidden";
    document.getElementById("registerform").style.visibility="visible";
    
    //document.getElementById("messages").style.display="none";
    $("#loginhead").animate({height: "500px"});
    $("#searchDiv").animate({paddingTop:"200px"},{complete:function(){
        
    }});
}
</script>
</head>

<body style="margin:0;padding:0">

<div id="loginhead" style="">
    <img src="<?php echo base_url()?>images/sitImg.png"  style="z-index:5;position:absolute; width: 90%;margin-left: 5%"/>
    <div style="z-index:10; position:absolute;padding: 0 0 0 200px">
<div id="statichead">
	<div id="left_logo">

	<img style="" src="<?php echo base_url()?>images/images/logo.png"/>
	</div>
	<div id="right_login">
	<form id="loginform"  action="<?php echo base_url(); ?>userprofile/login" method="post" >
	<table>
		<tr>
                    <td><label for="email" class="font_style">E-mail</label></td>
			<td><label class="font_style" for="password" >Password</label></td>
		</tr>
		<tr>
			<td><input id="email" name="email" type="text" class="inputtext" tabindex="1" /></td>
			<td><input id="password" name="password" type="password" class="inputtext" tabindex="2" /></td>
			<td><input id="submitlogin" type="submit" value="login" tabindex="3" /></td>
                        <a id="show_reg" onclick="showReg()">Register!</a>
		</tr>
	</table>
	</form>
	</div>
    <div id="adv">

        <div id="searchDiv" style="padding-top:200px">
            <img style="position:absolute;width:35px;height:35px;float: right; margin: 3px 0 0 5px; z-index:1000" src="<?php echo base_url()?>images/png/Search.png"/>
        <input id="search" placeholder="Search in Public Situations"  onkeypress="searchKeyPress(event);"/>
        <br/>
        <div id="searchResults" ></div>
        </div>
        
	</div>
<div id="register">
		<h2 class="font_style">Create an Account!</h2>
		<form id="registerform" action="<?php echo base_url(); ?>userprofile/register" method="post" >
			<table cellpadding="2px">
				<tr>
					
					<td><input placeholder="First Name " id="fname" name="fname" type="text" required autocomplete="off" class="reg_input" /></td>
				</tr>
				<tr>
					
					<td><input placeholder="Last Name" id="lname" name="lname" type="text" required autocomplete="off"  class="reg_input" /></td>
				</tr>
				<tr>
					
					<td><input placeholder="E-Mail" id="remail" name="remail" type="email" required autocomplete="off"  class="reg_input" /></td>
				</tr>
				<tr>
					
					<td><input id="remailvalid" placeholder="Re-enter E-Mail" name="remailvalid" type="email" required autocomplete="off"   class="reg_input" /></td>
				</tr>
				<tr>
					
					<td><input id="rpassword" placeholder="Password" name="rpassword" type="password" autocomplete="off" required  class="reg_input" /></td>
				</tr>
				<tr>
					
					<td><input id="rpasswordconfirm" placeholder="Confirm Password" name="rpasswordconfirm" type="password" required autocomplete="off"  class="reg_input" /></td>
				</tr>
				<tr>
					
					<td><input id="birthday"  name="birthday" type="date" required autocomplete="off" value="Birthday" class="reg_input" /></td>
				</tr>
			</table>
			<div style=" margin:20px 0 0 110px"><input style="padding:5px 20px;font-weight:bold;cursor:pointer;border:0" type="submit" value="Sign Up"/></div>
		</form>
		
	</div>
</div></div>
</div>
<div id="messages_container">
<div id="messages" <?php if(isset($result))echo "style=\"display:block\""; ?>><?php if(isset($result))echo $result; ?></div>
</div>
<div id="container">
<div id="content">
	
	
</div>
</div>

<div id="NotSupported" style="display: none"></div>
<script type="text/javascript">
txt = "Unfortunately, you are using "+navigator.appName+" which is not supported by our system.<br/>"
txt += "List of supported browsers are:<br/>";

if(navigator.appName == "Microsoft Internet Explorer"){
    document.getElementById("NotSupported").style.display="block";
    document.getElementById("NotSupported").innerHTML= txt;
}

</script>
</body>

</html>
